home *** CD-ROM | disk | FTP | other *** search
/ Softdisk for Windows 42 / Softdisk for Windows 42.iso / INSTALL / L_RALLY / OLDZIP / L_RALLY.EXE / Ana.dxr / 00001.ls next >
Encoding:
Text File  |  1998-01-23  |  4.0 KB  |  168 lines

  1. on startMovie
  2.   global sLettre1, sPoussoir1, nFacteur, Saddit, lesPositions, niveau, sOmbre, sEcran
  3.   set sEcran to 45
  4.   set sLettre1 to 3
  5.   set sPoussoir1 to 39
  6.   set sOmbre to 35
  7.   set Saddit to 34
  8.   if not voidp(niveau) then
  9.     set dest to "niv" & niveau
  10.   else
  11.     set dest to "niv1"
  12.   end if
  13.   go(dest)
  14. end
  15.  
  16. on monteLaCol qui
  17.   global sPoussoir1, lesN, lesPositions
  18.   set colonne to qui - sPoussoir1 + 1
  19.   effetPoussoir(qui)
  20.   set deb to getAt(lesN, colonne)
  21.   set fin to getAt(lesN, colonne + 1) - 1
  22.   if the locV of sprite deb < 121 then
  23.     setAt(lesPositions, colonne, 0)
  24.     repeat while the locV of sprite fin < 341
  25.       puppetSound("Chrunt")
  26.       repeat with fois = 1 to 11
  27.         repeat with s = deb to fin
  28.           set the locV of sprite s to the locV of sprite s + 4
  29.         end repeat
  30.         attends(1)
  31.         updateStage()
  32.       end repeat
  33.     end repeat
  34.   else
  35.     setAt(lesPositions, colonne, getAt(lesPositions, colonne) + 1)
  36.     puppetSound("JeGlisse")
  37.     repeat with fois = 1 to 11
  38.       repeat with s = deb to fin
  39.         set the locV of sprite s to the locV of sprite s - 4
  40.       end repeat
  41.       attends(1)
  42.       updateStage()
  43.     end repeat
  44.   end if
  45.   if verifieSolutionFinale() then
  46.     onLa()
  47.     retourne(1)
  48.   end if
  49. end
  50.  
  51. on effetPoussoir qui
  52.   puppetSound("vrouit")
  53.   repeat with fois = 1 to 2
  54.     repeat with c = 234 down to 225
  55.       set the foreColor of sprite qui to c
  56.       updateStage()
  57.       attends(1)
  58.     end repeat
  59.   end repeat
  60.   set the foreColor of sprite qui to 255
  61.   updateStage()
  62. end
  63.  
  64. on echangeMoi qui
  65.   global Saddit, sPoussoir1, sOmbre
  66.   if the visible of sprite sPoussoir1 then
  67.     exit
  68.   end if
  69.   switche(qui, Saddit)
  70.   set the visible of sprite sOmbre to 1
  71.   set the loc of sprite sOmbre to the loc of sprite Saddit
  72.   set limiteInf to qui - 1
  73.   repeat while the locH of sprite limiteInf = the locH of sprite qui
  74.     set limiteInf to limiteInf - 1
  75.   end repeat
  76.   set limiteInf to limiteInf + 1
  77.   set leVcible to the locV of sprite limiteInf
  78.   if limiteInf < qui then
  79.     descendsLes(limiteInf, qui - 1)
  80.   end if
  81.   replaceLe(Saddit, leVcible)
  82.   switche(Saddit, limiteInf)
  83.   puppetSound("click")
  84.   updateStage()
  85.   if verifieSolution() then
  86.     partTwo()
  87.   end if
  88. end
  89.  
  90. on partTwo
  91.   global sPoussoir1
  92.   set the visible of sprite (sPoussoir1 - 1) to 1
  93.   repeat with s = sPoussoir1 to sPoussoir1 + 5
  94.     set the visible of sprite s to 1
  95.     set the foreColor of sprite s to 255
  96.   end repeat
  97.   puppetSound("plrou")
  98.   updateStage()
  99. end
  100.  
  101. on lequel num
  102.   global sLettre1, lesN
  103.   repeat with col = 1 to 6
  104.     if num >= getAt(lesN, col) then
  105.       return col
  106.     end if
  107.   end repeat
  108.   return 0
  109. end
  110.  
  111. on replaceLe qui, ou
  112.   global sOmbre
  113.   set the visible of sprite sOmbre to 1
  114.   set delta to ou - the locV of sprite qui
  115.   if delta > 0 then
  116.     set diff to 4
  117.   else
  118.     set diff to -4
  119.   end if
  120.   repeat while abs(the locV of sprite qui - ou) > 4
  121.     set the locV of sprite qui to the locV of sprite qui + diff
  122.     set the loc of sprite sOmbre to the loc of sprite qui
  123.     updateStage()
  124.   end repeat
  125.   set the locV of sprite qui to ou
  126.   set the visible of sprite sOmbre to 0
  127.   updateStage()
  128. end
  129.  
  130. on descendsLes deb, fin
  131.   global Saddit, sOmbre
  132.   repeat with s = fin down to deb
  133.     switche(s, s + 1)
  134.   end repeat
  135.   set diff to 4
  136.   repeat with pos = 1 to 11
  137.     repeat with s = deb + 1 to fin + 1
  138.       set the locV of sprite s to the locV of sprite s + 4
  139.     end repeat
  140.     set the locV of sprite Saddit to the locV of sprite Saddit - 4
  141.     set the loc of sprite sOmbre to the loc of sprite Saddit
  142.     updateStage()
  143.     attends(1)
  144.   end repeat
  145.   puppetSound("move-a-tile")
  146.   updateStage()
  147. end
  148.  
  149. on verifieSolutionFinale
  150.   global lesPosFinales, lesPositions
  151.   repeat with col = 1 to 6
  152.     if getAt(lesPosFinales, col) <> getAt(lesPositions, col) then
  153.       return 0
  154.     end if
  155.   end repeat
  156.   return 1
  157. end
  158.  
  159. on verifieSolution
  160.   global sLettre1, laSolution, lesN
  161.   repeat with s = 1 to count(laSolution)
  162.     if getAt(laSolution, s) <> the memberNum of sprite (s + sLettre1 - 1) then
  163.       return 0
  164.     end if
  165.   end repeat
  166.   return 1
  167. end
  168.